package com.baishui.gateway.utils;

import java.io.InputStream;
import java.io.OutputStream;

public abstract class JarHelper {

    public static void toBytes(InputStream inputStream, OutputStream outputStream) {
        try {
            byte[] data = new byte[2048];
            /**
             * 额外注意
             * 不然会出现多写入的情况
             */
            int len = -1;
            while ((len = inputStream.read(data)) != -1) {
                outputStream.write(data, 0, len);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
